function WebUploaderUtils(options){
    var self =this;
    this.options={
        "auto":true,
        "instance":"",
        "wrapperId":"#picker",
        "server":"http://webuploader.duapp.com/server/fileupload.php",
        "swf":"https://cdn.bootcss.com/webuploader/0.1.1/Uploader.swf",
        "uploadSuccessCallBack":function(file){
            console.log("文件上传成功")
        },
        "uploadErrorCallBack":function(file){
            console.log("文件上传失败")
        },
        "uploadCompleteCallBack":function(file){
            console.log("文件上传完成")
        },
        "fileQueuedCallBack":function(file){
            console.log("文件进入队列")
        },
        "uploadProgressCallBack":function(file, percentage){
            console.log("uploadProgress")
        }
    }
    this.options = Object.assign(this.options, options);//将设定参数和默认参数进行合并操作;

    WebUploaderUtils.prototype.init=function(){
        var uploader = WebUploader.create({
            // swf文件路径
            swf: self.options.swf,
            // 文件接收服务端。
            server:self.options.server,
            // 选择文件的按钮。可选。
            // 内部根据当前运行是创建，可能是input元素，也可能是flash.
            pick: self.options.wrapperId,
            // 不压缩image, 默认如果是jpeg，文件上传前会压缩一把再上传！
            resize: false,
            auto:self.options.auto
        });
        self.options.instance=uploader;
        uploader.on( 'fileQueued', function( file ) {
            self.options.fileQueuedCallBack(file);
        });

        uploader.on( 'uploadProgress', function( file, percentage ) {
           self.options.uploadProgressCallBack(file, percentage)
        })
        uploader.on( 'uploadSuccess', function( file ) {
           self.options.uploadSuccessCallBack(file)
        });

        uploader.on( 'uploadError', function( file ) {
            self.options.uploadErrorCallBack(file)
        });

        uploader.on( 'uploadComplete', function( file ) {
            self.options.uploadCompleteCallBack(file)
        });

    }
}